<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>代码生成器</title>
	<%@include file="/include/easyui.jsp" %>
	<script src="<%=cxtPath %>/resources/js/comm/comm.js"></script>
	<script src="<%=cxtPath %>/resources/js/cg/cg.js"></script>
	
</head>
<body class="easyui-layout">
	<div region="north" title="单表维护" style="height:210px">
		<form id="gcform" method="post" action="">
			<table>
				<tr>
					<td>
						<input class="easyui-combobox"  label="表名:" style="width:300px" name="tablename" data-options="
							url:'queryTables',
							required:true,
							method:'get',
							valueField:'name',
							textField:'name',
							onSelect:function(r){loadColumn(r)},
							panelHeight:'auto'">
					</td>
					<td colspan="4"><span id="tablecomments"></span></td>
				</tr>
				<tr>
					<td>
						<input class="easyui-textbox" label="工程名:" style="width:300px" name="projectName" data-options="required:true"></input>
					</td>
					<td>
						<input class="easyui-textbox" label="作者:" style="width:300px" name="author" data-options="required:true"></input>
					</td>
					<td>
						<input class="easyui-textbox" label="标题:" style="width:300px" name="title" data-options="required:true"></input>
					</td>
				</tr>
				<tr>
					<td>
						<input class="easyui-textbox" label="java路径:" value="src\main\java" style="width:300px" name="javaSrc" data-options="required:true"></input>
					</td>
					<td>
						<input class="easyui-textbox" label="jsp路径:" value="src\main\webapp\WEB-INF\views" style="width:300px" name="jspSrc" data-options="required:true"></input>
					</td>
					
				</tr>
				<tr>
					<td>
						<input class="easyui-textbox" label="js路径:" value="src\main\webapp\resources\js" style="width:300px" name="jsSrc" data-options="required:true"></input>
					</td>
					<td>
						<input class="easyui-textbox" label="excel路径:" value="src\main\webapp\resources\excel" style="width:300px" name="excelSrc" data-options="required:true"></input>
					</td>
				</tr>
				<tr>
					<td>
						<input class="easyui-textbox" label="包名:" value="com.xxx" style="width:300px" name="packagename" data-options="required:true"></input>
					</td>
					<td>
						<input class="easyui-textbox" label="类名:" style="width:300px" name="classname" data-options="required:true"></input>
					</td>
					<td>
						<input class="easyui-combobox" label="主键策略:" name="pkstrategy" style="width:150px"  data-options="
							valueField:'id',
							textField:'text',
							data:[{id:1,text:'UUID'},{id:2,text:'自增'}],
							panelHeight:'auto'">
					</td>
				</tr>
				<tr>
					<td>
						<input class="easyui-combobox" label="查询条件:" name="searchCount" style="width:300px"  data-options="
							valueField:'id',
							textField:'text',
							data:[{id:2,text:'两列'},{id:3,text:'三列'}],
							panelHeight:'auto'">
					</td>
					 <td colspan="3">
						<a href="javascript:accept()" class="easyui-linkbutton" data-options="iconCls:'icon-save'" >保存设置</a>
						<a href="javascript:generatorSingle()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">生成代码</a>
						<span id="resultSrc" style="color:green"></span>
	            	</td>
				</tr>
				
				
			</table>		
		</form>

	</div>
	<div region="center"  border="false">
		<table class="easyui-datagrid" title="表字段" id="columnList"
			data-options="rownumbers:true,width:'auto',fit:true,onClickRow: onClickRow,
			 onLoadSuccess:function(){createTooltip('columnList');},method:'get'">
		<thead>
			<tr>
				<th data-options="field:'id',checkbox:true">ID</th>
				<th data-options="field:'name',width:150">名称</th>
				<th data-options="field:'comments',width:200,formatter:formatToolTip">描述</th>
				<th data-options="field:'datatype',width:80">字段类型</th>
				<th data-options="field:'datalength',width:60,align:'right'">字段长度</th>
				<th data-options="field:'nullable',width:60">是否为空</th>
				
				<th data-options="field:'ispk',width:50">主键</th>
				<th data-options="field:'ispersistence',width:50,editor:{type:'checkbox',options:{on:'Y',off:'N'}}">持久化</th>	
				<th data-options="field:'issearch',width:50,editor:{type:'checkbox',options:{on:'Y',off:'N'}}">查询</th>	
				<th data-options="field:'isshow',width:50,editor:{type:'checkbox',options:{on:'Y',off:'N'}}">显示</th>
				<th data-options="field:'orderby',width:100,
						editor:{
							type:'combobox',
							options:{
								valueField:'text',
								textField:'value',
								data:[
								{text:'无',value:'无'},
								{text:'1asc',value:'1asc'},
								{text:'1desc',value:'1desc'},
								{text:'2asc',value:'2asc'},
								{text:'2desc',value:'2desc'},
								{text:'3asc',value:'3asc'},
								{text:'3desc',value:'3desc'}
								]
							}
						}">排序</th>
				<th data-options="field:'propertyname',width:150,editor:{type:'textbox'}">属性名</th>			
				<th data-options="field:'javatype',width:100,
						editor:{
							type:'combobox',
							options:{
								valueField:'text',
								textField:'value',
								data:[{text:'Integer',value:'Integer'},
								{text:'Long',value:'Long'},
								{text:'Double',value:'Double'},
								{text:'String',value:'String'},
								{text:'Date',value:'Date'},
								{text:'DateTime',value:'DateTime'}
								]
							}
						}">数据类型</th>
				<th data-options="field:'op',width:100,formatter:oprow">操作</th>
			</tr>
		</thead>
	</table>
	</div>
	
	
</body>
</html>